package com.sugar.queryinfo.module.business.dal.mysql.apitypeinfo;

import java.util.*;

import com.sugar.queryinfo.framework.common.pojo.PageResult;
import com.sugar.queryinfo.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.queryinfo.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.queryinfo.module.business.dal.dataobject.apitypeinfo.ApiTypeInfoDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.queryinfo.module.business.controller.admin.apitypeinfo.vo.*;

/**
 * API类型 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface ApiTypeInfoMapper extends BaseMapperX<ApiTypeInfoDO> {

    default PageResult<ApiTypeInfoDO> selectPage(ApiTypeInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ApiTypeInfoDO>()
                .likeIfPresent(ApiTypeInfoDO::getName, reqVO.getName())
                .betweenIfPresent(ApiTypeInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ApiTypeInfoDO::getSort, ApiTypeInfoDO::getId));
    }

}